<template>
	<view>
		<view class="baseInfo">
			<image :src="userInfo.imageUrl"></image>
			<view class="info">
				<text class="info-item">{{userInfo.depart}}</text>
				<text class="info-item">{{userInfo.name}}</text>
				<text class="info-item">{{userInfo.id}}</text>
			</view>
		</view>
		<view class="common-menu">
			<view class="menu-item">
				<text class="iconfont">&#xe89f;</text>
				密码修改
				<text class="iconfont right">&#xe600;</text>
			</view>
			<view class="menu-item" @click="jumpTo('../tutor/baseInfo/baseInfo')">
				<text class="iconfont">&#xe661;</text>
				基本信息
				<text class="iconfont right">&#xe600;</text>
			</view>
		</view>
		<view class="person-menu" v-if="isStudent">
			
		</view>
		<view class="person-menu" v-else>
			<view class="menu-item" @click="jumpTo('../tutor/achievement/achievementList')">
				<text class="iconfont">&#xe66e;</text>
				成果展示
				<text class="iconfont right">&#xe600;</text>
			</view>
			<view class="menu-item" @click="jumpTo('../tutor/recruit/recruitInfo')">
				<text class="iconfont">&#xe637;</text>
				招生资格
				<text class="iconfont right">&#xe600;</text>
			</view>
			<view class="menu-item" @click="jumpTo('../tutor/teamAdmission/admissionsTeam')">
				<text class="iconfont">&#xe60a;</text>
				招生团队
				<text class="iconfont right">&#xe600;</text>
			</view>
			<view class="menu-item" @click="jumpTo('../tutor/studentInfo/lookStudentInfo')">
				<text class="iconfont">&#xe61a;</text>
				学生信息
				<text class="iconfont right">&#xe600;</text>
			</view>
			<view class="menu-item" @click="homePage">
				<text class="iconfont">&#xe60c;</text>
				个人主页
				<text class="iconfont right">&#xe600;</text>
			</view>
		</view>
		<view class="common-menu">
			<button type="default">退出登录</button>
		</view>

	</view>
</template>

<script>
	import * as request from '@/api/tHomePage.js'
	export default {
		data() {
			return {
				userInfo: {
					name: '',
					depart: '',
					id: getApp().globalData.id,
					imageUrl: 'https://gitee.com/zhuyu2/personal_picture_bed/raw/master/no-pic.png'
				},
				infoForm: null,
				imageUrl: "",
				isStudent:false
			}
		},
		methods: {
			jumpTo(path) {
				uni.navigateTo({
					url: path
				})
			},
			homePage(){
				this.jumpTo('../tutor/baseInfo/homePage?tid='+getApp().globalData.tid)
			},
			getData(){
				request.findPersonById({
					id: getApp().globalData.id,
				}).then(res=>{
					this.userInfo.name = res.data.data.name
					this.userInfo.depart = res.data.data.depart
				})
			}

		},
		onLoad() {
			this.getData()
		}
	}
</script>

<style>
	page {
		background-color: #f0f0f0;
	}



	.iconfont {
		font-family: "iconfont" !important;
		font-size: 20px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		margin-right: 20rpx;
		color: #4CD964;
	}

	.right {
		float: right;
		color: #cbcbcb;
	}

	.baseInfo {
		width: 100%;
		height: 150px;
		border: 1px solid transparent;
		background-color: #c8c7cc;
	}

	.baseInfo image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 200rpx;
		margin: 50rpx;
		float: left;
	}

	.info .info-item {
		display: block;
		margin-top: 30rpx;
		color: #FFFFFF;
	}

	.menu-item {
		margin: 0 40rpx;
		padding-left: 20rpx;
		height: 80rpx;
		line-height: 80rpx;
		border-bottom: 1px solid #E2EDF4;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		font-size: 30rpx;
	}

	.common-menu,
	.person-menu {
		margin-top: 30rpx;
	}

	.common-menu button {
		margin: 40rpx;
		background-color: #FFFFFF;
		border-radius: 30rpx;
	}
</style>
